package graphique;

import ij.process.ImageProcessor;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JTextField;

import application.LineSegmentFitting;

public class LinePanelListener implements ActionListener {
	private JTextField lineHeigthStep = null;
	private JTextField lineWidthStep = null;
	
	public LinePanelListener(JTextField lineHeigthStep, JTextField lineWidthStep) {
		this.lineHeigthStep=lineHeigthStep;
		this.lineWidthStep=lineWidthStep;
	}

	@Override
	public void actionPerformed(ActionEvent arg0) {
		ImageProcessor result = LineSegmentFitting.run(Principal.image, Integer.parseInt(lineHeigthStep.getText()), Integer.parseInt(lineWidthStep.getText()));
		Principal.actualiseImage(result);
	}

}
